home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.Event;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.Vector;
-
- public class TickerTape extends Applet implements Runnable {
- int[] starts;
- URL[] theURLs;
- int numTokens;
- long speed = 250L;
- int theOffScreenPosition;
- int theDisplayWidth;
- int frameThickness;
- int ledSize;
- int scrollFactor;
- int ledSpacing;
- int ledType;
- Thread tickTock;
- Graphics offScreenGraphics;
- Dimension offScreenSize;
- Image offScreenImage;
- Color frameColour;
- Color backGround;
- Color LEDColour;
- Color LEDOffColour;
- int theXOffset;
- int theYOffset;
- URL theURLToGoTo;
- boolean mouseOut = true;
- boolean notUpdatedYet = true;
- int[][] itsData = new int[][]{{0, 0, 0, 0, 0, 0}, {0, 0, 380, 0, 0, 0}, {0, 12, 0, 12, 0, 0}, {80, 248, 80, 248, 80, 0}, {16, 168, 508, 168, 64, 0}, {140, 76, 32, 400, 392, 0}, {200, 308, 340, 136, 320, 0}, {0, 0, 12, 0, 0, 0}, {0, 248, 260, 0, 0, 0}, {0, 0, 260, 248, 0, 0}, {168, 112, 508, 112, 168, 0}, {0, 32, 112, 32, 0, 0}, {0, 512, 384, 0, 0, 0}, {0, 32, 32, 32, 0, 0}, {0, 0, 256, 0, 0, 0}, {128, 64, 32, 16, 8, 0}, {112, 136, 260, 136, 112, 0}, {0, 272, 508, 256, 0, 0}, {408, 324, 324, 292, 280, 0}, {136, 260, 260, 292, 216, 0}, {48, 40, 36, 508, 32, 0}, {316, 292, 292, 292, 192, 0}, {248, 292, 292, 292, 192, 0}, {0, 4, 388, 100, 28, 0}, {216, 292, 292, 292, 216, 0}, {24, 292, 292, 292, 248, 0}, {0, 0, 160, 0, 0, 0}, {0, 512, 416, 0, 0, 0}, {0, 32, 80, 136, 0, 0}, {0, 80, 80, 80, 0, 0}, {0, 136, 80, 32, 0, 0}, {8, 4, 324, 36, 24, 0}, {248, 260, 372, 340, 56, 0}, {496, 72, 68, 72, 496, 0}, {508, 292, 292, 292, 216, 0}, {248, 260, 260, 260, 136, 0}, {508, 260, 260, 260, 248, 0}, {508, 292, 292, 292, 260, 0}, {508, 36, 36, 4, 4, 0}, {248, 260, 260, 292, 232, 0}, {508, 32, 32, 32, 508, 0}, {0, 0, 508, 0, 0, 0}, {192, 256, 256, 256, 252, 0}, {508, 32, 80, 136, 260, 0}, {508, 256, 256, 256, 256, 0}, {508, 8, 16, 8, 508, 0}, {508, 8, 16, 32, 508, 0}, {248, 260, 260, 260, 248, 0}, {508, 36, 36, 36, 24, 0}, {248, 260, 324, 388, 504, 0}, {508, 36, 100, 164, 280, 0}, {152, 292, 292, 292, 200, 0}, {4, 4, 508, 4, 4, 0}, {252, 256, 256, 256, 252, 0}, {124, 128, 256, 128, 124, 0}, {252, 256, 128, 256, 252, 0}, {260, 136, 112, 136, 260, 0}, {12, 16, 480, 16, 12, 0}, {388, 324, 292, 276, 268, 0}, {0, 508, 260, 260, 0, 0}, {8, 16, 32, 64, 128, 0}, {0, 260, 260, 508, 0, 0}, {0, 32, 16, 32, 0, 0}, {256, 256, 256, 256, 256, 0}, {0, 4, 8, 0, 0, 0}, {128, 336, 336, 224, 256, 0}, {508, 288, 272, 272, 224, 0}, {224, 272, 272, 272, 0, 0}, {224, 272, 272, 292, 508, 0}, {224, 336, 336, 336, 96, 0}, {16, 504, 20, 4, 0, 0}, {224, 1296, 1296, 1296, 992, 0}, {4, 508, 16, 16, 480, 0}, {0, 0, 500, 0, 0, 0}, {512, 1024, 1012, 0, 0, 0}, {0, 508, 64, 160, 272, 0}, {0, 4, 508, 0, 0, 0}, {480, 16, 96, 16, 480, 0}, {496, 16, 16, 480, 0, 0}, {224, 272, 272, 272, 224, 0}, {2032, 160, 272, 272, 224, 0}, {224, 272, 272, 160, 2032, 0}, {0, 496, 32, 16, 16, 0}, {288, 336, 336, 336, 144, 0}, {0, 16, 252, 272, 0, 0}, {240, 256, 256, 256, 240, 0}, {48, 192, 256, 192, 48, 0}, {240, 256, 192, 256, 240, 0}, {272, 160, 64, 160, 272, 0}, {0, 1264, 1280, 768, 240, 0}, {272, 400, 336, 304, 272, 0}, {0, 32, 216, 260, 0, 0}, {0, 0, 508, 0, 0, 0}, {0, 260, 216, 32, 0, 0}, {32, 16, 32, 64, 32, 0}, {0, 0, 500, 0, 0, 0}, {224, 272, 1016, 272, 0, 0}, {278, 249, 273, 273, 128, 0}, {136, 112, 80, 112, 136, 0}, {44, 56, 488, 56, 44, 0}, {0, 0, 476, 0, 0, 0}, {56, 340, 340, 340, 224, 0}, {0, 4, 0, 4, 0, 0}, {248, 372, 396, 340, 248, 0}, {80, 106, 106, 106, 124, 0}, {32, 80, 168, 80, 136, 0}, {32, 32, 32, 32, 224, 0}, {32, 32, 32, 32, 32, 0}, {500, 212, 292, 260, 504, 0}, {0, 4, 4, 4, 0, 0}, {0, 7, 5, 7, 0, 0}, {0, 160, 240, 160, 0, 0}, {0, 9, 13, 11, 0, 0}, {0, 9, 11, 13, 0, 0}, {0, 4, 2, 0, 0, 0}, {1024, 1008, 256, 256, 240, 0}, {24, 36, 36, 508, 508, 0}, {0, 56, 56, 56, 0, 0}, {0, 1024, 1536, 0, 0, 0}, {0, 2, 15, 0, 0, 0}, {92, 98, 98, 98, 92, 0}, {136, 80, 168, 80, 32, 0}, {132, 94, 160, 208, 488, 0}, {68, 62, 336, 424, 320, 0}, {146, 86, 186, 208, 488, 0}, {128, 256, 276, 288, 192, 0}, {496, 73, 70, 72, 496, 0}, {496, 74, 69, 72, 496, 0}, {496, 74, 69, 74, 496, 0}, {498, 73, 70, 73, 496, 0}, {496, 74, 68, 74, 496, 0}, {496, 75, 71, 75, 496, 0}, {504, 36, 508, 292, 292, 0}, {248, 1284, 1796, 260, 136, 0}, {508, 293, 294, 292, 292, 0}, {508, 294, 293, 292, 292, 0}, {508, 294, 293, 294, 292, 0}, {508, 294, 292, 294, 292, 0}, {0, 0, 509, 2, 0, 0}, {0, 2, 509, 0, 0, 0}, {0, 2, 509, 2, 0, 0}, {0, 2, 508, 2, 0, 0}, {0, 0, 128, 320, 0, 0}, {510, 9, 18, 33, 508, 0}, {248, 261, 262, 260, 248, 0}, {248, 262, 261, 260, 248, 0}, {248, 262, 261, 262, 248, 0}, {250, 261, 262, 261, 248, 0}, {248, 262, 260, 262, 248, 0}, {0, 80, 32, 80, 0, 0}, {240, 200, 168, 152, 120, 0}, {252, 257, 258, 256, 252, 0}, {252, 258, 257, 256, 252, 0}, {252, 258, 257, 258, 252, 0}, {252, 258, 256, 258, 252, 0}, {12, 18, 481, 16, 12, 0}, {16, 504, 20, 492, 0, 0}, {508, 276, 276, 296, 192, 0}, {128, 338, 340, 224, 256, 0}, {128, 340, 338, 224, 256, 0}, {128, 340, 338, 228, 256, 0}, {132, 338, 340, 226, 256, 0}, {128, 340, 336, 228, 256, 0}, {128, 342, 342, 224, 256, 0}, {400, 336, 224, 336, 352, 0}, {224, 1296, 1808, 272, 0, 0}, {224, 338, 340, 336, 96, 0}, {224, 340, 338, 336, 96, 0}, {224, 340, 338, 340, 96, 0}, {224, 340, 336, 340, 96, 0}, {0, 2, 500, 0, 0, 0}, {0, 4, 498, 0, 0, 0}, {0, 4, 498, 4, 0, 0}, {0, 4, 496, 4, 0, 0}, {0, 0, 280, 128, 0, 0}, {500, 18, 20, 482, 0, 0}, {224, 274, 276, 272, 224, 0}, {224, 276, 274, 272, 224, 0}, {224, 276, 274, 276, 224, 0}, {228, 274, 276, 274, 224, 0}, {224, 276, 272, 276, 224, 0}, {32, 32, 168, 32, 32, 0}, {224, 400, 336, 304, 224, 0}, {240, 258, 260, 256, 240, 0}, {240, 260, 258, 256, 240, 0}, {240, 260, 258, 260, 240, 0}, {240, 260, 256, 260, 240, 0}, {0, 1268, 1282, 768, 240, 0}, {16, 504, 20, 508, 0, 0}, {0, 1268, 1280, 772, 240, 0}};
- String[] theEntities = new String[]{"", "", "", "", "", "", "", "", "", " ", "
", "", "", "
", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "&sp;", "!", """, "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "‐", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\", "]", "ˆ", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "˜", "", "", "", "", "", "", "
", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", " ", "¡", "¢", "£", "¤", "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "", "®", "&hibar;", "°", "±", "²", "³", "´", "µ", "¶", "·", "¸", "¹", "º", "»", "¼", "½", "¾", "¿", "À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "×", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ"};
-
- public int GetLine(char theCharacter, int theLine) {
- int index = theCharacter & 255;
- if (index >= 127 && index <= 160) {
- index = 32;
- } else if (index > 160) {
- index -= 34;
- }
-
- index -= 32;
- if (index < 0) {
- index = 0;
- } else if (index > 189) {
- index = 0;
- }
-
- return this.itsData[index][theLine];
- }
-
- public void start() {
- if (this.tickTock == null) {
- this.tickTock = new Thread(this);
- this.tickTock.start();
- }
-
- }
-
- public String[][] getParameterInfo() {
- String[][] info = new String[][]{{"text1", "string", "the text to display"}, {"speed", "integer", ""}, {"framecolor", "string", ""}, {"backcolor", "string", ""}, {"LEDcolor", "string", ""}, {"ledoffcolor", "string", ""}, {"FrameThick", "integer", ""}, {"LEDSize", "integer", ""}, {"scrollfactor", "integer", ""}, {"ledspacing", "integer", ""}, {"ledtype", "integer", "The shape of the LED: 0 = Square and 1 = Circular"}, {"href1", "URL", ""}};
- return info;
- }
-
- public void stop() {
- if (this.tickTock != null) {
- this.tickTock.stop();
- this.tickTock = null;
- }
-
- }
-
- public int HTMLtoISO(String theString) {
- char secondChar = theString.charAt(1);
- if (theString.charAt(0) != '&') {
- return 0;
- } else if (Character.isDigit(theString.charAt(1))) {
- int result = Integer.valueOf(theString.substring(1, theString.indexOf(59, 2)));
- return result;
- } else {
- switch (secondChar) {
- case 'A':
- if (theString.startsWith("Agrave;", 1)) {
- return 192;
- } else if (theString.startsWith("Aacute;", 1)) {
- return 193;
- } else if (theString.startsWith("Acirc;", 1)) {
- return 194;
- } else if (theString.startsWith("Atilde;", 1)) {
- return 195;
- } else if (theString.startsWith("Auml;", 1)) {
- return 196;
- } else if (theString.startsWith("Aring;", 1)) {
- return 197;
- } else if (theString.startsWith("AElig;", 1)) {
- return 198;
- }
- case 'C':
- if (theString.startsWith("Ccedil;", 1)) {
- return 199;
- }
- case 'D':
- if (theString.startsWith("Dstrok;", 1)) {
- return 208;
- }
- case 'E':
- if (theString.startsWith("Egrave;", 1)) {
- return 200;
- } else if (theString.startsWith("Eacute;", 1)) {
- return 201;
- } else if (theString.startsWith("Ecirc;", 1)) {
- return 202;
- } else if (theString.startsWith("Euml;", 1)) {
- return 203;
- } else if (theString.startsWith("ETH;", 1)) {
- return 208;
- }
- case 'I':
- if (theString.startsWith("Igrave;", 1)) {
- return 204;
- } else if (theString.startsWith("Iacute;", 1)) {
- return 205;
- } else if (theString.startsWith("Icirc;", 1)) {
- return 206;
- } else if (theString.startsWith("Iuml;", 1)) {
- return 207;
- }
- case 'N':
- if (theString.startsWith("Ntilde;", 1)) {
- return 209;
- }
- case 'O':
- if (theString.startsWith("Ograve;", 1)) {
- return 210;
- } else if (theString.startsWith("Oacute;", 1)) {
- return 211;
- } else if (theString.startsWith("Ocirc;", 1)) {
- return 212;
- } else if (theString.startsWith("Otilde;", 1)) {
- return 213;
- } else if (theString.startsWith("Ouml;", 1)) {
- return 214;
- } else if (theString.startsWith("Oslash;", 1)) {
- return 216;
- }
- case 'T':
- if (theString.startsWith("THORN;", 1)) {
- return 222;
- }
- case 'U':
- if (theString.startsWith("Ugrave;", 1)) {
- return 217;
- } else if (theString.startsWith("Uacute;", 1)) {
- return 218;
- } else if (theString.startsWith("Ucirc;", 1)) {
- return 219;
- } else if (theString.startsWith("Uuml;", 1)) {
- return 220;
- }
- case 'Y':
- if (theString.startsWith("Yacute;", 1)) {
- return 221;
- }
- case 'a':
- if (theString.startsWith("agrave;", 1)) {
- return 224;
- } else if (theString.startsWith("aacute;", 1)) {
- return 225;
- } else if (theString.startsWith("acirc;", 1)) {
- return 226;
- } else if (theString.startsWith("atilde;", 1)) {
- return 227;
- } else if (theString.startsWith("auml;", 1)) {
- return 228;
- } else if (theString.startsWith("aring;", 1)) {
- return 229;
- } else if (theString.startsWith("aelig;", 1)) {
- return 230;
- } else if (theString.startsWith("amp;", 1)) {
- return 38;
- } else if (theString.startsWith("apos;", 1)) {
- return 39;
- } else if (theString.startsWith("ast;", 1)) {
- return 42;
- } else if (theString.startsWith("acute;", 1)) {
- return 180;
- } else if (theString.startsWith("angst;", 1)) {
- return 197;
- }
- case 'b':
- if (theString.startsWith("blank;", 1)) {
- return 32;
- } else if (theString.startsWith("bsol;", 1)) {
- return 92;
- } else if (theString.startsWith("brvbar;", 1)) {
- return 166;
- } else if (theString.startsWith("brkbar;", 1)) {
- return 166;
- }
- case 'c':
- if (theString.startsWith("ccedil;", 1)) {
- return 231;
- } else if (theString.startsWith("comma;", 1)) {
- return 44;
- } else if (theString.startsWith("colon;", 1)) {
- return 58;
- } else if (theString.startsWith("commat;", 1)) {
- return 64;
- } else if (theString.startsWith("circ;", 1)) {
- return 94;
- } else if (theString.startsWith("caret;", 1)) {
- return 94;
- } else if (theString.startsWith("cent;", 1)) {
- return 162;
- } else if (theString.startsWith("curren;", 1)) {
- return 164;
- } else if (theString.startsWith("copy;", 1)) {
- return 169;
- } else if (theString.startsWith("cedil;", 1)) {
- return 184;
- }
- case 'd':
- if (theString.startsWith("divide;", 1)) {
- return 247;
- } else if (theString.startsWith("dollar;", 1)) {
- return 36;
- } else if (theString.startsWith("dash;", 1)) {
- return 45;
- } else if (theString.startsWith("die;", 1)) {
- return 168;
- } else if (theString.startsWith("deg;", 1)) {
- return 176;
- }
- case 'e':
- if (theString.startsWith("egrave;", 1)) {
- return 232;
- } else if (theString.startsWith("eacute;", 1)) {
- return 233;
- } else if (theString.startsWith("ecirc;", 1)) {
- return 234;
- } else if (theString.startsWith("euml;", 1)) {
- return 235;
- } else if (theString.startsWith("eth;", 1)) {
- return 240;
- } else if (theString.startsWith("excl;", 1)) {
- return 33;
- } else if (theString.startsWith("equals;", 1)) {
- return 61;
- }
- case 'f':
- if (theString.startsWith("frac14;", 1)) {
- return 188;
- } else if (theString.startsWith("frac12;", 1)) {
- return 189;
- } else if (theString.startsWith("frac34;", 1)) {
- return 190;
- }
- case 'g':
- if (theString.startsWith("gt;", 1)) {
- return 62;
- } else if (theString.startsWith("grave;", 1)) {
- return 96;
- }
- case 'h':
- if (theString.startsWith("hyphen;", 1)) {
- return 45;
- } else if (theString.startsWith("hibar;", 1)) {
- return 175;
- } else if (theString.startsWith("half;", 1)) {
- return 189;
- }
- case 'i':
- if (theString.startsWith("igrave;", 1)) {
- return 236;
- } else if (theString.startsWith("iacute;", 1)) {
- return 237;
- } else if (theString.startsWith("icirc;", 1)) {
- return 238;
- } else if (theString.startsWith("iuml;", 1)) {
- return 239;
- } else if (theString.startsWith("iexcl;", 1)) {
- return 161;
- } else if (theString.startsWith("iquest;", 1)) {
- return 191;
- }
- case 'l':
- if (theString.startsWith("lpar;", 1)) {
- return 40;
- } else if (theString.startsWith("lt;", 1)) {
- return 60;
- } else if (theString.startsWith("lsqb;", 1)) {
- return 91;
- } else if (theString.startsWith("lowbar;", 1)) {
- return 95;
- } else if (theString.startsWith("lcub;", 1)) {
- return 123;
- } else if (theString.startsWith("laquo;", 1)) {
- return 171;
- }
- case 'm':
- if (theString.startsWith("minus;", 1)) {
- return 45;
- } else if (theString.startsWith("macr;", 1)) {
- return 175;
- } else if (theString.startsWith("micro;", 1)) {
- return 181;
- } else if (theString.startsWith("middot;", 1)) {
- return 183;
- }
- case 'n':
- if (theString.startsWith("ntilde;", 1)) {
- return 241;
- } else if (theString.startsWith("num;", 1)) {
- return 35;
- } else if (theString.startsWith("nbsp;", 1)) {
- return 160;
- } else if (theString.startsWith("not;", 1)) {
- return 172;
- }
- case 'o':
- if (theString.startsWith("ograve;", 1)) {
- return 242;
- } else if (theString.startsWith("oacute;", 1)) {
- return 243;
- } else if (theString.startsWith("ocirc;", 1)) {
- return 244;
- } else if (theString.startsWith("otilde;", 1)) {
- return 245;
- } else if (theString.startsWith("ouml;", 1)) {
- return 246;
- } else if (theString.startsWith("oslash;", 1)) {
- return 248;
- } else if (theString.startsWith("ordf;", 1)) {
- return 170;
- } else if (theString.startsWith("ordm;", 1)) {
- return 186;
- }
- case 'p':
- if (theString.startsWith("percnt;", 1)) {
- return 37;
- } else if (theString.startsWith("plus;", 1)) {
- return 43;
- } else if (theString.startsWith("period;", 1)) {
- return 46;
- } else if (theString.startsWith("pound;", 1)) {
- return 163;
- } else if (theString.startsWith("plusmn;", 1)) {
- return 177;
- } else if (theString.startsWith("para;", 1)) {
- return 182;
- }
- case 'q':
- if (theString.startsWith("quot;", 1)) {
- return 34;
- } else if (theString.startsWith("quest;", 1)) {
- return 63;
- }
- case 'r':
- if (theString.startsWith("rpar;", 1)) {
- return 41;
- } else if (theString.startsWith("rsqb;", 1)) {
- return 93;
- } else if (theString.startsWith("rcub;", 1)) {
- return 125;
- } else if (theString.startsWith("reg;", 1)) {
- return 174;
- } else if (theString.startsWith("raquo;", 1)) {
- return 187;
- }
- case 's':
- if (theString.startsWith("sp;", 1)) {
- return 32;
- } else if (theString.startsWith("sol;", 1)) {
- return 47;
- } else if (theString.startsWith("semi;", 1)) {
- return 59;
- } else if (theString.startsWith("sim;", 1)) {
- return 126;
- } else if (theString.startsWith("sect;", 1)) {
- return 167;
- } else if (theString.startsWith("shy;", 1)) {
- return 173;
- } else if (theString.startsWith("sup2;", 1)) {
- return 178;
- } else if (theString.startsWith("sup3;", 1)) {
- return 179;
- } else if (theString.startsWith("sup1;", 1)) {
- return 185;
- }
- case 't':
- if (theString.startsWith("thorn;", 1)) {
- return 254;
- } else if (theString.startsWith("tilde;", 1)) {
- return 126;
- } else if (theString.startsWith("times;", 1)) {
- return 215;
- }
- case 'u':
- if (theString.startsWith("ugrave;", 1)) {
- return 249;
- } else if (theString.startsWith("uacute;", 1)) {
- return 250;
- } else if (theString.startsWith("ucirc;", 1)) {
- return 251;
- } else if (theString.startsWith("uuml;", 1)) {
- return 252;
- } else if (theString.startsWith("uml;", 1)) {
- return 168;
- }
- case 'y':
- if (theString.startsWith("yacute;", 1)) {
- return 253;
- } else if (theString.startsWith("yuml;", 1)) {
- return 255;
- } else if (theString.startsWith("yen;", 1)) {
- return 165;
- }
- default:
- return 0;
- }
- }
- }
-
- public Color GetColourFromString(String theParam) {
- if (theParam.equalsIgnoreCase("BLACK")) {
- return Color.black;
- } else if (theParam.equalsIgnoreCase("BLUE")) {
- return Color.blue;
- } else if (theParam.equalsIgnoreCase("CYAN")) {
- return Color.cyan;
- } else if (theParam.equalsIgnoreCase("DARKGRAY")) {
- return Color.darkGray;
- } else if (theParam.equalsIgnoreCase("GRAY")) {
- return Color.gray;
- } else if (theParam.equalsIgnoreCase("GREEN")) {
- return Color.green;
- } else if (theParam.equalsIgnoreCase("LIGHTGRAY")) {
- return Color.lightGray;
- } else if (theParam.equalsIgnoreCase("MAGENTA")) {
- return Color.magenta;
- } else if (theParam.equalsIgnoreCase("ORANGE")) {
- return Color.orange;
- } else if (theParam.equalsIgnoreCase("PINK")) {
- return Color.pink;
- } else if (theParam.equalsIgnoreCase("RED")) {
- return Color.red;
- } else if (theParam.equalsIgnoreCase("WHITE")) {
- return Color.white;
- } else {
- return theParam.equalsIgnoreCase("YELLOW") ? Color.yellow : Color.black;
- }
- }
-
- public boolean mouseExit(Event evt, int x, int y) {
- this.notUpdatedYet = true;
- this.mouseOut = true;
- return true;
- }
-
- public boolean mouseMove(Event evt, int x, int y) {
- if (this.theURLToGoTo != null && this.notUpdatedYet) {
- this.notUpdatedYet = false;
- }
-
- return true;
- }
-
- public boolean mouseDown(Event evt, int x, int y) {
- if (this.theURLToGoTo != null) {
- }
-
- return true;
- }
-
- public boolean mouseEnter(Event evt, int x, int y) {
- if (this.theURLToGoTo != null) {
- }
-
- this.mouseOut = false;
- return true;
- }
-
- public boolean mouseDrag(Event evt, int x, int y) {
- if (this.theURLToGoTo != null && this.notUpdatedYet) {
- this.notUpdatedYet = false;
- }
-
- return true;
- }
-
- private void DrawOffScreenBackground() {
- this.offScreenGraphics.setColor(this.backGround);
- this.offScreenGraphics.fillRect(0, 0, this.offScreenSize.width, this.offScreenSize.height);
- }
-
- public String getAppletInfo() {
- return new String("NetObjects TickerTape");
- }
-
- public void ISO8859() {
- }
-
- public void setBackgroundColor(String color) {
- this.backGround = this.GetColourFromString(color);
- this.DrawOffScreenBackground();
- ((Component)this).repaint();
- }
-
- public boolean mouseUp(Event evt, int x, int y) {
- int cnt = -1;
- int position = x + this.theOffScreenPosition - this.theDisplayWidth;
- if (position >= this.starts[0] && position < this.starts[this.numTokens]) {
- for(cnt = 1; cnt < this.numTokens && position >= this.starts[cnt]; ++cnt) {
- }
-
- this.theURLToGoTo = this.theURLs[cnt - 1];
- } else {
- this.theURLToGoTo = null;
- }
-
- if (this.theURLToGoTo != null && !this.mouseOut) {
- ((Applet)this).getAppletContext().showDocument(this.theURLToGoTo);
- }
-
- return true;
- }
-
- public String ISOtoHTML(int theChar) {
- return theChar >= 0 && theChar <= 255 ? this.theEntities[theChar] : "";
- }
-
- public void run() {
- while(true) {
- try {
- Thread.currentThread();
- Thread.sleep(this.speed);
- } catch (InterruptedException var3) {
- }
-
- super.repaint();
- }
- }
-
- public String About() {
- return "Netobjects TickerTape";
- }
-
- private URL MakeAbsoluteURL(String param) throws MalformedURLException {
- URL theURL = null;
- String fullBase = ((Applet)this).getDocumentBase().toString();
- String documentBase = fullBase.substring(0, fullBase.lastIndexOf(47));
-
- try {
- if (param.startsWith(".")) {
- param = param.replace('\\', '/');
- param = documentBase + "/" + param;
- } else if (param.startsWith("#")) {
- param = ((Applet)this).getDocumentBase().toString() + param;
- } else if (!param.startsWith("cid:") && !param.startsWith("lifn:") && !param.startsWith("java:") && !param.startsWith("irc:") && !param.startsWith("IOR:") && !param.startsWith("ilu:") && !param.startsWith("https:") && !param.startsWith("http:") && !param.startsWith("hdl:") && !param.startsWith("gopher:") && !param.startsWith("ftp:") && !param.startsWith("finger:") && !param.startsWith("file:") && !param.startsWith("data:") && !param.startsWith("clsid:") && !param.startsWith("md5:") && !param.startsWith("mailserver:") && !param.startsWith("mailto:") && !param.startsWith("mid:") && !param.startsWith("news:") && !param.startsWith("nntp:") && !param.startsWith("path:") && !param.startsWith("prospero:") && !param.startsWith("service:") && !param.startsWith("shttp") && !param.startsWith("snews") && !param.startsWith("STANF:") && !param.startsWith("telnet:") && !param.startsWith("vemmi:") && !param.startsWith("wais:") && !param.startsWith("whois++:")) {
- param = "http://" + param;
- }
-
- theURL = new URL(param);
- } catch (MalformedURLException var7) {
- theURL = null;
- }
-
- return theURL;
- }
-
- public void init() {
- String param = ((Applet)this).getParameter("speed");
- this.SetSpeed(param == null ? 100L : 5L * (51L - Integer.valueOf(param).longValue()));
- param = ((Applet)this).getParameter("framecolour");
- if (param == null) {
- param = ((Applet)this).getParameter("framecolor");
- }
-
- this.frameColour = param == null ? Color.green : this.GetColourFromString(param);
- param = ((Applet)this).getParameter("backcolour");
- if (param == null) {
- param = ((Applet)this).getParameter("backcolor");
- }
-
- this.backGround = param == null ? Color.black : this.GetColourFromString(param);
- param = ((Applet)this).getParameter("LEDcolour");
- if (param == null) {
- param = ((Applet)this).getParameter("LEDcolor");
- }
-
- this.LEDColour = param == null ? Color.green : this.GetColourFromString(param);
- param = ((Applet)this).getParameter("ledoffcolour");
- if (param == null) {
- param = ((Applet)this).getParameter("ledoffcolor");
- }
-
- this.LEDOffColour = param == null ? this.backGround : this.GetColourFromString(param);
- param = ((Applet)this).getParameter("FrameThick");
- this.frameThickness = param == null ? 1 : Integer.valueOf(param);
- param = ((Applet)this).getParameter("LEDSize");
- this.ledSize = param == null ? 2 : Integer.valueOf(param);
- param = ((Applet)this).getParameter("scrollfactor");
- this.scrollFactor = param == null ? 2 : Integer.valueOf(param);
- param = ((Applet)this).getParameter("ledspacing");
- this.ledSpacing = param == null ? 1 : Integer.valueOf(param);
- param = ((Applet)this).getParameter("ledtype");
- this.ledType = param == null ? 0 : Integer.valueOf(param);
- if (this.ledType > 1) {
- this.ledType = 1;
- }
-
- if (this.ledSize == 1) {
- this.ledType = 0;
- }
-
- param = ((Applet)this).getParameter("width");
- int theWidth = param == null ? 80 : Integer.valueOf(param);
- param = ((Applet)this).getParameter("height");
- int theHeight = param == null ? 39 : Integer.valueOf(param);
- ((Applet)this).resize(theWidth, theHeight);
- this.theDisplayWidth = theWidth - this.frameThickness * 2 - 1;
- this.theXOffset = this.frameThickness + 1;
- this.theYOffset = (theHeight - (this.ledSize + this.ledSpacing) * 11) / 2;
- String allTheText = "";
- Vector theTexts = new Vector();
-
- String theText;
- for(int cnt = 1; (theText = ((Applet)this).getParameter("text" + cnt)) != null; ++cnt) {
- int theTextLength = theText.length();
- StringBuffer finalText = new StringBuffer();
-
- for(int i = 0; i < theTextLength; ++i) {
- if (theText.charAt(i) != '&') {
- finalText.append(theText.charAt(i));
- } else {
- int semiColon = theText.indexOf(59, i + 1);
- int theChar;
- if (semiColon != -1) {
- theChar = this.HTMLtoISO(theText.substring(i, semiColon + 1));
- if (theChar == 0) {
- theChar = 38;
- } else {
- i = semiColon;
- }
- } else {
- theChar = 38;
- }
-
- finalText.append((char)theChar);
- }
- }
-
- theText = finalText.toString();
- allTheText = allTheText + theText;
- theTexts.addElement(theText);
- }
-
- this.numTokens = theTexts.size();
- this.starts = new int[this.numTokens + 1];
- this.starts[0] = this.theDisplayWidth;
-
- for(int cnt = 1; cnt <= this.numTokens; ++cnt) {
- this.starts[cnt] = this.starts[cnt - 1] + ((String)theTexts.elementAt(cnt - 1)).length() * 6 * (this.ledSize + this.ledSpacing);
- }
-
- theText = allTheText;
- int var27 = allTheText.length();
- int theNumberOfLines = allTheText.length() * 6 + 2 * this.theDisplayWidth / (this.ledSize + this.ledSpacing);
- this.offScreenSize = new Dimension(theNumberOfLines * (this.ledSize + this.ledSpacing), (this.ledSize + this.ledSpacing) * 11);
- this.offScreenImage = ((Component)this).createImage(this.offScreenSize.width, this.offScreenSize.height);
- this.offScreenGraphics = this.offScreenImage.getGraphics();
- this.theOffScreenPosition = this.theDisplayWidth;
- this.DrawOffScreenBackground();
- theNumberOfLines = this.theDisplayWidth / (this.ledSize + this.ledSpacing);
- this.offScreenGraphics.setColor(this.LEDOffColour);
-
- for(int var22 = 0; var22 < theNumberOfLines; ++var22) {
- int k = 0;
-
- while(true) {
- if (this.ledType == 0) {
- this.offScreenGraphics.fillRect(var22 * (this.ledSize + this.ledSpacing), k * (this.ledSize + this.ledSpacing), this.ledSize, this.ledSize);
- } else {
- this.offScreenGraphics.fillOval(var22 * (this.ledSize + this.ledSpacing), k * (this.ledSize + this.ledSpacing), this.ledSize, this.ledSize);
- }
-
- ++k;
- if (k >= 11) {
- break;
- }
- }
- }
-
- int displacement = (theNumberOfLines - 1) * (this.ledSize + this.ledSpacing);
-
- for(int var23 = 0; var23 < var27; ++var23) {
- int j = 0;
-
- while(true) {
- int theLine = this.GetLine(theText.charAt(var23), j);
- int var25 = 0;
-
- do {
- int theBit = theLine >> var25;
- if ((theBit & 1) == 1) {
- this.offScreenGraphics.setColor(this.LEDColour);
- } else {
- this.offScreenGraphics.setColor(this.LEDOffColour);
- }
-
- if (this.ledType == 0) {
- this.offScreenGraphics.fillRect(displacement + (var23 * 6 + j) * (this.ledSize + this.ledSpacing), var25 * (this.ledSize + this.ledSpacing), this.ledSize, this.ledSize);
- } else {
- this.offScreenGraphics.fillOval(displacement + (var23 * 6 + j) * (this.ledSize + this.ledSpacing), var25 * (this.ledSize + this.ledSpacing), this.ledSize, this.ledSize);
- }
-
- ++var25;
- } while(var25 < 11);
-
- ++j;
- if (j >= 6) {
- break;
- }
- }
- }
-
- displacement += var27 * 6 * (this.ledSize + this.ledSpacing);
- theNumberOfLines = this.theDisplayWidth / (this.ledSize + this.ledSpacing);
- this.offScreenGraphics.setColor(this.LEDOffColour);
-
- for(int var24 = 0; var24 < theNumberOfLines; ++var24) {
- int var26 = 0;
-
- while(true) {
- if (this.ledType == 0) {
- this.offScreenGraphics.fillRect(displacement + var24 * (this.ledSize + this.ledSpacing), var26 * (this.ledSize + this.ledSpacing), this.ledSize, this.ledSize);
- } else {
- this.offScreenGraphics.fillOval(displacement + var24 * (this.ledSize + this.ledSpacing), var26 * (this.ledSize + this.ledSpacing), this.ledSize, this.ledSize);
- }
-
- ++var26;
- if (var26 >= 11) {
- break;
- }
- }
- }
-
- this.theURLs = new URL[this.numTokens];
-
- for(int cnt = 1; cnt <= this.numTokens; ++cnt) {
- param = ((Applet)this).getParameter("link" + cnt);
- if (param != null) {
- try {
- this.theURLToGoTo = this.MakeAbsoluteURL(param);
- } catch (MalformedURLException var21) {
- this.theURLToGoTo = null;
- }
-
- this.theURLs[cnt - 1] = this.theURLToGoTo;
- }
- }
-
- }
-
- public void paint(Graphics g) {
- Color oldColour = g.getColor();
- g.setColor(this.frameColour);
- g.fillRect(0, 0, ((Component)this).bounds().width, ((Component)this).bounds().height);
- g.setColor(this.backGround);
- g.fillRect(this.frameThickness, this.frameThickness, this.theDisplayWidth, ((Component)this).bounds().height - this.frameThickness * 2 - 1);
- this.update(g);
- g.setColor(oldColour);
- }
-
- public final synchronized void update(Graphics g) {
- g.clipRect(this.theXOffset, this.theYOffset, this.theDisplayWidth - 2, this.offScreenSize.height);
- int theTranslation = this.theOffScreenPosition > this.theDisplayWidth ? this.theOffScreenPosition - this.theDisplayWidth : -(this.theDisplayWidth - this.theOffScreenPosition);
- g.drawImage(this.offScreenImage, -theTranslation + this.theXOffset, this.theYOffset, this);
- this.theOffScreenPosition += (this.ledSize + this.ledSpacing) * this.scrollFactor;
- if (this.theOffScreenPosition > this.offScreenSize.width) {
- this.theOffScreenPosition = this.theDisplayWidth;
- }
-
- }
-
- public void SetSpeed(long theNewSpeed) {
- this.speed = theNewSpeed;
- }
-
- public long GetSpeed() {
- return this.speed;
- }
- }
-